package dome_013;

import java.util.concurrent.LinkedTransferQueue;

/**
 * <p>Description: []</p>
 * Created on 2020/12/15
 *
 * @author <a href="mailto: 819712047@qq.com">谢振东 </a>
 * @version 1.0
 */
public class T08_TransferQueue {
    public static void main(String[] args) throws InterruptedException {
        LinkedTransferQueue<String> strings = new LinkedTransferQueue<String>();

		/*new Thread(()->{
			try {
				System.out.println(strings.take());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}).start();*/

        //strings.transfer("aaa");

        strings.put("aaa");

        new Thread(() -> {
            try {
                System.out.println(strings.take());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();
    }
}
